﻿<%@ Page Title="Cungmuanao.com - Quản Lý thông tin trang chủ" Language="C#" MasterPageFile="~/Admin/Admin.master" 
    ValidateRequest="false" AutoEventWireup="true" CodeFile="ManageIntro.aspx.cs" Inherits="ManageIntro" %>
<%@ Import Namespace="DTO" %>
<%@ Register src="../Controls/FileUpload.ascx" tagname="FileUpload" tagprefix="uc1" %>
<%--<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>--%>
<%@ Register assembly="CKEditor.NET" namespace="CKEditor.NET" tagprefix="CKEditor" %>
<%@ Register Src="~/Controls/AsyncFileUpload.ascx" TagPrefix="uc2" TagName="AsyncFileUpload" %>

<asp:Content ID="Content1" ContentPlaceHolderID="LeftContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<%--<script type="text/javascript" src="../js/nicEdit.js"></script>
<script type="text/javascript">
    bkLib.onDomLoaded(function () {
        nicEditors.allTextAreas()
    });
</script>--%>
<p>
    <uc2:AsyncFileUpload runat="server" ID="AsyncFileUpload" />
</p>
<asp:DetailsView runat="server" ID="dvwCurrBracnh" DefaultMode="Edit"
        AutoGenerateRows="False" DataKeyNames="ID" Width="100%" 
    DataSourceID="objCurrPage" onitemcreated="dvwCurrBracnh_ItemCreated" >
    <FieldHeaderStyle Width="120px" />
    <Fields>                
        <asp:TemplateField HeaderText="Chào mừng" >
            <ItemTemplate>
               <asp:Label ID="lblName" runat="server" Text='<%# Eval("Body") %>' Width="100%"></asp:Label>
            </ItemTemplate>        
            <EditItemTemplate>
                <%--<fckeditorv2:fckeditor id="txtBody" runat="server" Value='<%# Bind("Body") %>'
                      ToolbarSet="PhuocHoa_Basic" Height="200px" Width="100%" />  --%>              
                      <%--<asp:TextBox ID="txtBody" runat="server" Text='<%# Bind("Body") %>' Rows="5" 
                      TextMode="MultiLine" Width="100%" MaxLength="4000"></asp:TextBox>--%>
                  <CKEditor:CKEditorControl ID="txtBody" runat="server" Text='<%# Bind("Body") %>'></CKEditor:CKEditorControl>
            </EditItemTemplate>
        </asp:TemplateField>
          <asp:CommandField ButtonType="Image" ShowCancelButton="false" 
                ShowEditButton="True" UpdateImageUrl="~/Images/capnhat.png" 
              UpdateText="Cập nhật" />        
    </Fields>
    </asp:DetailsView>
    
    <asp:ObjectDataSource runat="server" ID="objCurrPage" TypeName="BLL.Pages.Pages" SelectMethod="GetPage" 
    UpdateMethod="UpdatePage">
        <SelectParameters>
            <asp:Parameter DefaultValue="2" Name="PageID" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="id" Type="Int32" DefaultValue="2" />
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="importance" Type="Int32" />
            <asp:Parameter Name="Abstract" Type="String" />
            <asp:Parameter Name="body" Type="String" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    <p></p>    
  <asp:DetailsView runat="server" ID="DetailsView_Banner" DefaultMode="Edit"
        AutoGenerateRows="False" DataKeyNames="ID" Width="100%"
    DataSourceID="objBanner" >
    <FieldHeaderStyle Width="120px" />
    <Fields>                   
        <asp:TemplateField HeaderText="Hình">
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Abstract") %>' Width="100%" />
            </ItemTemplate>
        </asp:TemplateField>             
        <asp:TemplateField HeaderText="Link" >
            <EditItemTemplate>
                <asp:TextBox runat="server" ID="txtImage" Text='<%#Bind("Abstract") %>' Width="99%" />
            </EditItemTemplate>
        </asp:TemplateField>
          <asp:CommandField ButtonType="Image" ShowCancelButton="false" 
                ShowEditButton="True" UpdateImageUrl="~/Images/capnhat.png" 
              UpdateText="Cập nhật" />        
    </Fields>
    </asp:DetailsView>
    
    <asp:ObjectDataSource runat="server" ID="objBanner" TypeName="BLL.Pages.Pages" SelectMethod="GetPage" 
    UpdateMethod="UpdatePage">
        <SelectParameters>
            <asp:Parameter DefaultValue="6" Name="PageID" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="id" Type="Int32" DefaultValue="6" />
            <asp:Parameter Name="title" Type="String" ConvertEmptyStringToNull="false"/>
            <asp:Parameter Name="importance" Type="Int32" />
            <asp:Parameter Name="Abstract" Type="String" ConvertEmptyStringToNull="false" />
            <asp:Parameter Name="body" Type="String" ConvertEmptyStringToNull="false" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    <p></p>     
        <asp:DetailsView runat="server" ID="DetailsView1" DefaultMode="Edit"
        AutoGenerateRows="False" DataKeyNames="ID" Width="100%" 
    DataSourceID="objFooter" onitemcreated="DetailsView1_ItemCreated" >
    <FieldHeaderStyle Width="120px" />
    <Fields>                   
        <asp:TemplateField HeaderText="Giới thiệu ở cuối sản phẩm" >
            <ItemTemplate>
               <asp:Label ID="lblName" runat="server" Text='<%# Eval("Body") %>' Width="100%"></asp:Label>
            </ItemTemplate>         
            <EditItemTemplate>
                <%--<asp:TextBox ID="txtBody" runat="server" Text='<%# Bind("Body") %>' Rows="5" 
                      TextMode="MultiLine" Width="100%" MaxLength="4000"></asp:TextBox>  --%>
              <CKEditor:CKEditorControl ID="txtBody" runat="server" Text='<%# Bind("Body") %>'></CKEditor:CKEditorControl>                                    
            </EditItemTemplate>
        </asp:TemplateField>
          <asp:CommandField ButtonType="Image" ShowCancelButton="false" 
                ShowEditButton="True" UpdateImageUrl="~/Images/capnhat.png" 
              UpdateText="Cập nhật" />        
    </Fields>
    </asp:DetailsView>
    
    <asp:ObjectDataSource runat="server" ID="objFooter" TypeName="BLL.Pages.Pages" SelectMethod="GetPage" 
    UpdateMethod="UpdatePage">
        <SelectParameters>
            <asp:Parameter DefaultValue="8" Name="PageID" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="id" Type="Int32" DefaultValue="8"/>
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="importance" Type="Int32" />
            <asp:Parameter Name="Abstract" Type="String" />
            <asp:Parameter Name="body" Type="String" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    <uc1:FileUpload ID="FileUpload1" runat="server" />
        
</asp:Content>

